//
//  SNKPrettyGirlCell.m
//  SleepNews
//
//  Created by Kavee DJ on 2017/2/20.
//  Copyright © 2017年 Kavee DJ. All rights reserved.
//

#import "SNKPrettyGirlCell.h"

#import "SNKPrettyGirlData.h"

#import <UIImageView+WebCache.h>

@interface SNKPrettyGirlCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@property (weak, nonatomic) IBOutlet UILabel *praiseLabel;
@property (weak, nonatomic) IBOutlet UILabel *dislikeLabel;
@property (weak, nonatomic) IBOutlet UILabel *commentLabel;

@end

@implementation SNKPrettyGirlCell

- (void)setPrettyGirlData:(SNKPrettyGirlData *)prettyGirlData {
    _prettyGirlData = prettyGirlData;
    
    self.titleLabel.text = prettyGirlData.title;
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:prettyGirlData.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.praiseLabel.text = prettyGirlData.upTimes;
    self.dislikeLabel.text = prettyGirlData.downTimes;
    self.commentLabel.text = prettyGirlData.replyCount;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageV.frame = self.prettyGirlData.middleFrame;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}

//各个cell间距值为10
- (void)setFrame:(CGRect)frame{
    frame.size.height -= 10;
    //重写覆盖frame
    [super setFrame:frame];
}

@end
